package com.company.wushuo.justfortest;


import java.util.concurrent.ThreadFactory;

import rx.Scheduler;
import rx.internal.schedulers.NewThreadWorker;


/**
 * Cublic reated by wushuo on 2021/4/27
 */
public class NamedThreadSchedulers extends Scheduler {

    private final ThreadFactory threadFactory;

    public NamedThreadSchedulers(ThreadFactory threadFactory) {
        this.threadFactory = threadFactory;
    }

    @Override
    public Scheduler.Worker createWorker() {
        return new NamedNewThreadWorker(threadFactory);
    }

    public static class NamedNewThreadWorker extends NewThreadWorker {

        public NamedNewThreadWorker(ThreadFactory threadFactory) {
            super(threadFactory);
        }
    }
}
